<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      font-size: 40px;
      color: rosybrown;
      background-color: salmon;
      border: 10px solid forestgreen;
    }

    .boxs {
      box-shadow: 5px 5px 5px 5px 5px purple;
    }

    .txts {
      text-shadow: 5px 5px 5px purple;
    }

    .tac {
      text-align: center;
      line-height: 200px;
    }
  </style>
</head>

<body>
  <div class="box">
    1231231213
  </div>

  <script>
    let div = document.querySelector("div");
    div.className = div.className + " tac"
    console.log();


    // let count = 0;
    // div.addEventListener("click", function () {
    //   count += 1;
    //   if (count % 2 == 0) {
    //     div.classList.remove("tac");
    //   } else {
    //     div.classList.add("tac");

    //   }

    // })

    // div.addEventListener("click", function () {
    //   if (div.classList.contains("tac")) {
    //     div.classList.remove("tac");

    //   } else {
    //     div.classList.add("tac");

    //   }
    // div.classList.contains("tac") ? div.classList.remove("tac") : div.classList.add("tac");
    // div.classList.toggle("tac");
    // })




  </script>
</body>

</html>